// 路由配置文件
import { createRouter, createWebHashHistory } from 'vue-router'

// 创建路由对象并配置
const router = createRouter({
  // 使用hash模式跳转路由
  history: createWebHashHistory(),
  // 配置路由表
  routes: [
    { path: '/login', component: () => import('@/views/Login.vue') },
    {
      path: '/',
      redirect: '/dashboard',
      component: () => import('@/layout/Index.vue'),
      children: [
        { path: '/dashboard', name: 'dashboard', component: () => import('@/views/Dashboard.vue'), meta: { title: '数据分析' }  },
        { path: '/recom', name: 'recom', component: () => import('@/views/Recom.vue'), meta: { title: '推荐游记' } },
        { path: '/system', name: 'system', component: () => import('@/views/System.vue'), meta: { title: '系统管理' } },
        { path: '/user', name: 'user', component: () => import('@/views/User.vue'), meta: { title: '用户管理' } },
        { path: '/dayRecom', name: 'dayRecom', component: () => import('@/views/DayRecom.vue'), meta: { title: '每日推荐' } },
        { path: '/article', name: 'article', component: () => import('@/views/Article.vue'), meta: { title: '游记管理' } },
      ]
    }
  ]
})

export default router